from glob import glob
Import('env')

src_env = env.Clone()
src_env['extension'] = 'cpp'
src_env['srcroot'] += '/eventrpc'
src_env['objroot'] += '/eventrpc'

Export('src_env')

src_files = [
  'log.cpp',
  'time_utility.cpp',
  'monitor.cpp',
  'lookup3.cpp',
  'utility.cpp',
  'net_address.cpp',
  'net_utility.cpp',
  'file_utility.cpp',
  'string_utility.cpp',
  'thread.cpp',
  'dispatcher.cpp',
  'buffer.cpp',
  'rpc_channel.cpp',
  'rpc_controller.cpp',
  'rpc_server.cpp',
  'rpc_method_manager.cpp',
  'message_channel.cpp',
  'message_connection.cpp',
  'message_server.cpp',
  'message_connection_manager.cpp',
  'message_utility.cpp',
]

eventrpc_header_files = [
  'log.h',
  'base.h',
  'thread.h',
  'file_utility.h',
  'string_utility.h',
  'noncopyable.h',
  'dispatcher.h',
  'monitor.h',
  'event.h',
  'mutex.h',
]
eventrpc = src_env.StaticLibrary('eventrpc', src_files)
env.Install("/usr/local/lib", eventrpc)
env.Install("/usr/local/include/eventrpc", eventrpc_header_files)
env.Alias('install', ['/usr/local/lib', '/usr/local/include/eventrpc'])
